<template>
    <div>
        <el-bread></el-bread>
        <el-button class="btn" type="primary" size="small" @click="addDialog">添加</el-button>
        <v-list @edit="edit"></v-list>
        <v-dialog ref="dialogInfo" :isAdd="isAdd" @cancel="cancel" :isShow="isShow"></v-dialog>
    </div>
</template>

<script>
import vList from '../menu/list.vue'
import vDialog from '../menu/dialog.vue'
export default {
    data() {
        return {
            isShow: false,
            isAdd: false
        };
    },
    components: {
        vList,
        vDialog
    },
    methods: {
        addDialog() {
            this.isShow = true,
                this.isAdd = true
        },
        cancel(e) {
            // console.log(e);
            this.isShow = e
        },
        edit(e) {
            this.isShow = true
            this.isAdd = false
            this.$refs.dialogInfo.lookup(e)
        }
    },
};
</script>

<style lang="less"scoped>
.btn {
    margin: 15px 0;
}
</style>
